#!/bin/bash

#Invoke this script with a command to perform and a filename.

if [ -z "$1" ] || [ -z "$2" ]
then
  echo "Usage: $0 option filename, where option is one of the following:"
  echo "    p(arse)     simply parses the file"
  echo "    a(nalyze)   analyzes the patterns"
  exit 65
fi

PREFIX="ch.epfl.lara.pm."

case "$1" in
  "parse" | "p"		)	CLASS="parser.TestParser" ;;
  "analyze" | "a"	)	CLASS="analyze.TestVerification" ;;
  *					)	echo "Invalid option."; exit 65 ;;
esac

scala -classpath classes ${PREFIX}${CLASS} $2
